<template>
  <div class="boxs-item">
    <div class="boxs-right">
      <titles :title="props.info.text" style="margin-bottom: 120px; margin-top: 70px" />
      <textMax :data="props.info.remarks" :maxLen="115" />
      <div class="hw-box-style-flex" style="width: 100%">
        <div class="ornament" :style="{ background: store.styleInfo.themeColor }"></div>
      </div>
    </div>
    <div class="boxs-left">
      <div class="item-left">
        <div class="item-left-shadow" @click="pathChild(props.info.children[0])" style="cursor: pointer">
          <span
            class="titles"
            :style="{
              fontSize: store.styleInfo.mintitleSize,
              fontFamily: store.styleInfo.textFamily,
              color: '#fff',
            }"
            >{{ props.info.children[0].text }}</span
          >
          <span
            class="left-title1"
            :style="{
              fontSize: store.styleInfo.contentSize,
              fontFamily: store.styleInfo.textFamily,
              color: '#fff',
            }"
            >{{ props.info.children[0].remarks }}</span
          >
        </div>
        <img
          style="cursor: pointer"
          @click="pathChild(props.info.children[0])"
          class="item-left"
          :src="urls + props.info.children[0].value + '?imageView2/1/w/380/h/380/format/webp'"
          alt=""
          v-if="props.info.children[0].value"
        />

        <img
          style="cursor: pointer"
          @click="pathChild(props.info.children[0])"
          class="item-left"
          src="http://101.34.143.36:8890/api/image/387939155165253/h_380,w_380"
          alt=""
          v-else
        />
      </div>

      <div class="item-left-p">
        <div class="item-left-p-shadow" @click="pathChild(props.info.children[1])" style="cursor: pointer">
          <span
            class="titles"
            :style="{
              fontSize: store.styleInfo.mintitleSize,
              fontFamily: store.styleInfo.textFamily,
              color: '#fff',
            }"
            >{{ props.info.children[0].text }}</span
          >
          <span
            class="left-title1"
            :style="{
              fontSize: store.styleInfo.contentSize,
              fontFamily: store.styleInfo.textFamily,
              color: '#fff',
            }"
            >{{ props.info.children[0].remarks }}</span
          >
        </div>
        <img
          style="cursor: pointer"
          class="item-left-p"
          @click="pathChild(props.info.children[1])"
          :src="urls + props.info.children[1].value + '?imageView2/1/w/380/h/380/format/webp'"
          alt=""
          v-if="props.info.children[1].value"
        />

        <img
          style="cursor: pointer"
          @click="pathChild(props.info.children[1])"
          class="item-left-p"
          src="http://101.34.143.36:8890/api/image/387939155165253/h_380,w_380"
          alt=""
          v-else
        />
      </div>
    </div>
  </div>
</template>
<script setup lang="ts">
// @ts-nocheck
import { pathList, pathListLoop } from '../route';
import { urls } from '@/utils/request/upload';
import titles from '@/components/title/title.vue';
import buttonIcon from '@/components/title/buttonIcon.vue';
import textMax from '@/components/textMax/textMax.vue';
import { onMounted } from 'vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
import UnitImageNull from '@/components/unitImageNull/unitImageNull.vue';
const router = useRouter();
const route = useRoute();
const store = useProjectStore();
const props = defineProps({
  info: {
    type: Object,
  },
});
const pathChild = (e: any) => {
  store.setchildModel(e);
  router.push({
    name: route.meta.loopType ? pathListLoop[8] : pathList[8],
    query: {},
  });
};
</script>

<style lang="less" scoped>
@import './index.less';
.boxs-item {
  display: flex;
}
.boxs-left {
  position: relative;
  display: flex;
  flex: 1;
  margin-right: 20px;
  min-height: 580px;
  .item-left {
    position: absolute;
    width: 380px;
    height: 380px;
    top: 0;
    left: 0;
    .item-left-shadow {
      display: flex;
      flex-direction: column;
      justify-content: center;
      position: relative;
      width: 100%;
      height: 100%;
      z-index: 109;
      padding: 24px 82px;
      background: rgba(0, 0, 0, 0.3);
      opacity: 0;
      .titles {
        margin-bottom: 32px;
      }
    }
  }

  .item-left-p {
    position: absolute;
    width: 380px;
    height: 380px;
    bottom: 0;
    right: 0;
    .item-left-p-shadow {
      display: flex;
      flex-direction: column;
      justify-content: center;
      position: relative;
      width: 100%;
      height: 100%;
      z-index: 109;
      padding: 24px 82px;
      background: rgba(0, 0, 0, 0.3);
      opacity: 0;
      .titles {
        margin-bottom: 32px;
      }
    }
  }
  .item-left:hover {
    z-index: 99;
    .item-left-shadow {
      opacity: 1;
    }
  }
  .item-left-p:hover {
    z-index: 99;
    .item-left-p-shadow {
      opacity: 1;
    }
  }
}
.boxs-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 380px;
  height: 580px;
  margin-right: 120px;
}
</style>
